Repository navigation
fix(pm-stack): rung-4 escalation speaks the validated queue contract (#6033) - #11268
Conversation
…6033) The watchdog core (PR #11243) wires watchdog-escalation.ts into the live tick, but the production enqueueTask wrapper was not a valid repo-task/v1 packet: fleet queue validate rejects it on 13 fields (no payload.repo/problem/evidence/acceptance/tests/context_refs/scope/risk/timebox/dedupe, no payload identity, dedupe_key matching no design pattern). Since enqueue ran first, a live escalation created neither the queue task nor the incident issue. Fix: create the incident issue first (a small_fix packet's fix-family dedupe key must name an existing issue), stamp the confirmed issue number into the enqueue packet in applyEscalationActions, and translate the packet through the new pure buildQueueTaskWrapper (fix-family dedupe key, payload.issue.number, full escalation context in payload.escalation_packet). Partial-hand-off resume keeps its semantics, mirrored: a failed enqueue now surfaces the confirmed issue number and the retry plans only the missing task, whose packet carries the recorded number. Tests: exporters suite 39 pass (plan order, apply stamping, wrapper contract, resume packet, flipped partial-failure case, tick-level issue-before-enqueue assertion). The generated wrapper passes the real validator: packet valid (repo-task/v1).
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…sk (#6033) Live fixture demo (task 20118): recovery auto-commented and auto-closed the incident issue, but the queue task stayed queued — complete requires holding the claim and the watchdog never claims, so its best-effort complete always fails for a still-queued task (the common case: the source healed before a fixer picked the task up). completeTask now falls back, only when the task is untouched (no timeline records — an unclaimed task has none), to cancel with the recovery reason. A task with timeline records has an owner and is left to them; the auto-closed incident issue is their signal.
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex gate disposition (task 20118): the Codex review on this PR failed to run — "You have reached your Codex usage limits for code reviews" (initial run on 9d49f53 and again on the |
|
You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard. |
What
Wires rung-4 escalation into the fleet queue's validated contract so a live escalation actually creates its hand-off (task 20118, remainder of #6033).
The watchdog core from PR #11243 already calls
planEscalation/planRecoverywith production effectors — but the productionenqueueTaskwrapper was not a valid repo-task/v1 packet. Proven against the live validator before this change:Since enqueue ran first in the plan, a live escalation created neither the queue task nor the incident issue — the exact failure mode of the 2026-11-13→16 Mistral outage, one layer down.
Changes
planEscalationnow plansopen_issuebeforeenqueue_task— asmall_fixpacket's fix-family dedupe key (repo-health:v1:fix:<repo>:issue:<n>) must name an existing issue, withpayload.issue.numbermatching.buildQueueTaskWrapper(new, pure, inwatchdog-escalation.ts): translates an escalation packet into the validated repo-task/v1 envelope — fix-family dedupe key, payload identity, problem/evidence/acceptance/tests/context/scope/risk/timebox/dedupe all populated from the packet, and the full escalation packet riding inpayload.escalation_packetso a browser-enabled agent can start from the claimed task alone.applyEscalationActionsstamps the issue number confirmed earlier in the same run into the enqueue packet; a partial-resume packet carries its recorded number from the escalation record.EscalationPartialError, and the retry plans only the missing task.enqueueTaskinwatchdog.tsuses the wrapper builder (throws on a number-less packet instead of enqueueing an invalid one).Tests
bun test ../exporters/test/frompm-stack/aggregator: 39 pass, 0 fail — plan order, apply stamping, wrapper contract, resume packet, flipped partial-failure case, and a tick-level assertion that the issue is created before the enqueue that names it.packet valid (repo-task/v1).Refs #6033. Filed from queue task 20118 (lane any-l).
Live fixture demonstration (this branch, production effectors, 2026-11-17)
Two full cycles through the real CLI entry point (
bun src/watchdog.ts,QUOTA_WATCHDOG_LIVE=1, fixture adapter, scratch state tree):status: queued,dedupe_key: repo-health:v1:fix:developing-today/code:issue:11271, verified in the queue DB).since, same ids) and created nothing.fixtureproduced a fresh document…") and auto-closed the incident issue, and cleared the incident from the state file.queuedbecausecompleterequires holding a claim. Cycle 2's recovery cancelled task 20754 itself with the recovery reason (verified in the queue DB). Cycle 1's leftover task 20753 was cancelled with the same reason by hand.